//
//  CustomVIew.m
//  UI_作业03
//
//  Created by dllo on 16/6/7.
//  Copyright © 2016年 zuzhiming. All rights reserved.
//

#import "CustomVIew.h"

@interface CustomVIew ()
/**  活动标签视图 */
@property (nonatomic, retain) UIImageView *LeftImageView;


@end

@implementation CustomVIew

- (void)dealloc
{
    [_LeftImageView release];
    [super dealloc];
}
- (instancetype)initWithFrame:(CGRect)frame LeftImage:(UIImage *)leftImage LabelText:(NSString *)text
{
    self = [super initWithFrame:frame];
    if (self) {
        self.LeftImageView = [[UIImageView alloc] init];
        self.LeftImageView.image = leftImage;
        [self addSubview:_LeftImageView];
        [_LeftImageView release];
        
        self.rightLabel = [[UILabel alloc] init];
        self.rightLabel.text = text;
        self.rightLabel.font = [UIFont systemFontOfSize:13.0f];
        self.rightLabel.numberOfLines = 0;
//        self.rightLabel.textAlignment = NSTextAlignmentNatural;
        [self addSubview:_rightLabel];
        [_rightLabel release];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.LeftImageView.frame = CGRectMake(0, 0, self.frame.size.width / 10, self.frame.size.height);
    self.rightLabel.frame = CGRectMake(self.frame.size.width / 10 + 10, self.bounds.origin.y - 10, self.frame.size.width - self.LeftImageView.frame.size.width, self.frame.size.height + 20);
}


@end
